package com.buobao.task;

import com.buobao.service.BookService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 定时任务
 */
@Component
public class ComputeTask {
    @Resource
    private BookService bookService;


    /**
     * 每分钟执行一次
     */
    @Scheduled(cron = "0 * * * * ?")
    public void updateEvaluation(){
        bookService.updateEvaluation();
        System.out.println("update book evaluation.");
    }
}
